package com.bnz.controller;

import com.bnz.exception.MyException;
import com.bnz.pojo.R;
import com.bnz.service.HelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

    @Autowired
    private HelloService helloService;

    @GetMapping("/hello")
    public R hello() throws MyException {
        try {
            helloService.hello();
        }catch (MyException e){
            throw e;
        }
        return R.error();
    }



}
